package com.example.xmind2testcase.controller;

import com.example.xmind2testcase.service.FileService;
import com.example.xmind2testcase.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//import java.io.File;
import  com.example.xmind2testcase.pojo.File;

import java.util.ArrayList;

@RestController()
public class FileManageController {

    @Autowired
    private FileService fileService;

    @PostMapping("/file/addfile")
    public R addFile(@RequestBody File file){
        File file1 = fileService.addFile(file);
        return  R.ok(file1);
    }


    @PostMapping("/file/deletefile")
    public void deleteFile() {

    }

    @PostMapping("/file/updatefile")
    public void updateFile(){

    }


    @GetMapping("/file/queryfile/{projectId}")
    public R queryFile(@PathVariable("projectId") Long projectId){
        return R.ok(fileService.queryFile(projectId));
    }
}
